/**
 * Copyright 2010 Powersi. All rights reserved.
 * 
 */
package com.powersi.hygeia.framework.jdbclogger;

/*
 * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for
 * additional information regarding copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the "License"); you may not
 * use this file except in compliance with the License. You may obtain a copy of the License at
 * 
 * http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
 * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
 */
import java.sql.Connection;
import java.sql.Driver;
import java.sql.DriverPropertyInfo;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
import java.util.Properties;

/**
 * The Class AbstractWrapperDriver.
 * 
 */
public abstract class AbstractWrapperDriver implements Driver {

    /** The _driver. */
    protected Driver _driver;

    /** The formatters. */
    protected List formatters;

    /**
     * Instantiates a new abstract wrapper driver.
     */
    public AbstractWrapperDriver() {
        formatters = new ArrayList();
    }

    /**
     * Gets the driver.
     * 
     * @return the driver
     */
    public Driver getDriver() {
        return _driver;
    }

    /**
     * Sets the driver.
     * 
     * @param driver
     *            the new driver
     */
    public void setDriver(Driver driver) {
        _driver = driver;
    }

    /* (non-Javadoc)
     * @see java.sql.Driver#acceptsURL(java.lang.String)
     */
    public boolean acceptsURL(String s) throws SQLException {
        return _driver.acceptsURL(s);
    }

    /* (non-Javadoc)
     * @see java.sql.Driver#getMajorVersion()
     */
    public int getMajorVersion() {
        return _driver.getMajorVersion();
    }

    /* (non-Javadoc)
     * @see java.sql.Driver#getMinorVersion()
     */
    public int getMinorVersion() {
        return _driver.getMinorVersion();
    }

    /* (non-Javadoc)
     * @see java.sql.Driver#getPropertyInfo(java.lang.String, java.util.Properties)
     */
    public DriverPropertyInfo[] getPropertyInfo(String s, Properties properties) throws SQLException {
        return _driver.getPropertyInfo(s, properties);
    }

    /* (non-Javadoc)
     * @see java.sql.Driver#jdbcCompliant()
     */
    public boolean jdbcCompliant() {
        return _driver.jdbcCompliant();
    }

    /* (non-Javadoc)
     * @see java.sql.Driver#connect(java.lang.String, java.util.Properties)
     */
    public abstract Connection connect(String s, Properties properties) throws SQLException;

    /**
     * Gets the formatters.
     * 
     * @return the formatters
     */
    public List getFormatters() {
        return formatters;
    }

    /**
     * Sets the formatters.
     * 
     * @param formatters
     *            the formatters to set
     */
    public void setFormatters(List formatters) {
        this.formatters = formatters;
    }
}
